package com.lhc.custom.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.SourceLocation;
import org.springframework.stereotype.Component;

import java.util.Arrays;

@Aspect
@Component
public class CustomAspect {

    @After(value = "@annotation(com.lhc.custom.annotation.Aop)")
    public void pointCut(JoinPoint joinPoint) {
        System.out.println("joinPoint");
        Object[] args = joinPoint.getArgs();
        for (Object arg : args) {
            System.out.println(arg.getClass().getName());
        }
        System.out.println(Arrays.toString(args));
        System.out.println("joinPoint");
    }
}
